package cn.alusiaor.eurekaclientarticleservice.feignclient;


import cn.alusiaor.eurekaclientarticleservice.config.MultipartSupportConfig;
import cn.alusiaor.eurekaclientarticleservice.controller.ArticleController;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;

/**
 * @author zhuzhiping
 */
@FeignClient(value = "eureka-client-user-service", qualifier = "eureka-client-user-service", configuration = MultipartSupportConfig.class)
public interface UserService {
    @PostMapping("/user/hello")
    String callHello(@RequestBody ArticleController.UserDto userDto);


    @PostMapping(value = "/user/file/upload", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    File getFile(@RequestPart("file") MultipartFile file);
}
